class Review < ActiveRecord::Base
  belongs_to :user
  belongs_to :movie
  
  validates_presence_of :movie_id, :user_id, :score
  validates_inclusion_of :score, :in => 1..5, :message => "is not between 1 and 5!"
  validates_uniqueness_of :movie_id, :scope => :user_id, :message => "cannot have multiple scores from the same user!"
  
  def stars
    return "#{self.score} stars"
  end
end
